package com.lantosec.hmrp.modules.warning.entity;

import com.lantosec.hmrp.core.mvc.BaseEntity;
import com.lantosec.hmrp.modules.warning.vo.WarningTypeVO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;

/**
 * <p>
 *  实体类
 * </p>
 *
 * @author AutoCode
 * @since 2020-05-19
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class WarningType extends BaseEntity<WarningTypeVO> {

    private static final long serialVersionUID = 1L;
    public WarningType(WarningTypeVO vo){
        this.typeId = vo.getTypeId();
        this.typeName = vo.getTypeName();
        this.parentId = vo.getParentId();
        this.flag = vo.getFlag();
        this.leaf = vo.getLeaf();
        this.typeOrder = vo.getTypeOrder();
    }

    @Override
    public WarningTypeVO convertToVO(){
        return new WarningTypeVO(this);
    }


    /**
     * 预警类型ID
     */
    @TableId(value = "type_id", type = IdType.ASSIGN_ID)
    private String typeId;

    /**
     * 预警类型名称
     */
    private String typeName;

    /**
     * 类型上级ID
     */
    private String parentId;

    /**
     * 删除标识
     */
    private Integer flag;

    /**
     * 排序
     */
    private Integer typeOrder;

    /**
     * 是否末级
     */
    private Integer leaf;


    public enum ColName {
        type_id, type_name, parent_id, 
    }
}
